package searchable;

import visitor.Visitor;
import wrapper.Chr;
import wrapper.Dbl;
import wrapper.Int;
import wrapper.Str;

public class PrintTreeVisitor implements Visitor{

	@Override
	public void visit(Object object) {
		if(object != null)
		{
			if (object.getClass().equals(new Int(0).getClass())) {
				System.out.print(((Int) object).getValue() + ", ");
			} else if (object.getClass().equals(new Chr(' ').getClass())) {
				System.out.print(((Chr) object).getValue() + ", ");
			} else if (object.getClass().equals(new Dbl(0).getClass())) {
				System.out.print(((Dbl) object).getValue() + ", ");
			} else {
				System.out.print(((Str) object).getValue() + ", ");
			}
		}
		
	}

	@Override
	public boolean isDone() {
		// TODO Auto-generated method stub
		return false;
	}

}
